<!DOCTYPE html>
<html>
<head>
<title>商品列表</title>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="${staticUrl}static/script/jquery-1.8.2.min.js" ></script>
<link href="${staticUrl}static/styles/global.css" rel="stylesheet" type="text/css">
<style type="text/css">
.spring,.summer,.autumn,.winter{color:#c00;font-weight:bold !important}
</style>
<script>
var nowShowSku = false;
function showSKU(obj){
if(!!nowShowSku)
nowShowSku.hide();
nowShowSku = $(obj).parent().parent().next(".J_sku_box");
nowShowSku.show();
};
function ajaxUrl(url){
	$.ajax({
		url : url,
		success : function(){
			alert("操作成功");
		}
	})
}
</script>
</head>
<body>
<div id="J_bottomPageBox" class="xs-toolbar clearfix">
<@xpage currentPage="${(page.pageNo)!0}" totalPage="${(page.pageCount)!0}" theme="1"/>
</div>
<div class="config-box">
<table width="95%" class="config-table">
	<tr>
		<th>货号（ID）</th>
		<th>名称</th>
		<th>店铺</th>
		<th>SKU</th>
		<th>状态1</th>
		<th>状态2</th>
		<th>操作</th>
	</tr>
	<#if !goodsBoList?? || goodsBoList?size == 0>
	<tr>
		<td colspan=8>未找到数据！</td>
	</tr>
	<#else>
		<#list goodsBoList as goods>
		<tr id="J_item_${goods.id?string('#')}" class="${(goods_index%2==0)?string('even','')}">
			<td>${goods.id?string('#')}</td>
			<td><a href="${goods.taobaoItemUrl!'#'}" target="_blank">${goods.providerGoodsName}</a></td>
			<td>
			<#if goods.providerInfo??>
			【<span class="fb">${goods.providerInfo.offsale!'--'}</span>】<a href="${goods.providerInfo.taobaoHomeUrl}" target="_blank">（${goods.providerInfo.address}）${goods.providerInfo.name}</a>
			&nbsp;<a href="${requestUrl}goods/list.htm?providerId=${goods.providerInfo.id}">[只看]</a>
			</#if>
			</td>
			<td><a href="javascript:void(0);" onclick="showSKU(this);">查看</a></td>
			<td class="${goods.providerStatusEnum.name()?lower_case}">
				${goods.providerStatusEnum.desc}
			</td>
			<td class="${goods.statusEnum.name()?lower_case}">
				${goods.statusEnum.desc}
			</td>
			<td><a onclick="ajaxUrl('${requestUrl}goods/download-image.htm?id=${goods.id?string('#')}')" href="javascript:void(0);">下图</a> 
			<#if goods.statusEnum != 'ONLINE'>
			| <a href="${requestUrl}goods/change-status.htm?id=${goods.id?string('#')}&status=ONLINE">录入</a>
			</#if></td>
		</tr>
		<tr class="J_sku_box ${unfoldedFlag?string('','hide')}">
			<td colspan=8>
				<#if goods.minImgUrl??>
					<img style="max-height:180px;max-width:150px" src="${goods.minImgUrl}" class="fl"/>
				</#if>
				<#if goods.skuTable?? && goods.skuTable?size gt 0>
				<table class="fl">
					<tr>
						<th>&nbsp;</th>
						<#list goods.skuTable as skuBoList>
							<#list skuBoList as sku>
								<th>${sku.sizeAttrValue}</th>
							</#list>
							<#break>
						</#list>
					</tr>
					<#list goods.skuTable as skuBoList>
					<tr>
						<#list skuBoList as sku>
							<th>${sku.colorAttrValue}</th>
							<#break>
						</#list>
						<#list skuBoList as sku>
							<td>
							<#if sku.providerSkuPrice??>
								¥<span class="fb">${(sku.salePrice/100)?string('#.#')}</span> | ¥${(sku.providerSkuPrice/100)?string('#.#')} | ${sku.providerSkuStock}
							<#else>
								--
							</#if>
							</td>
						</#list>
					</tr>
					</#list>
				</table>
				</#if>
				<#if goods.attributesList?? && goods.attributesList?size gt 0>
				<#assign ind=0>
				<table class="fl ml10">
					<tr>
						<#list goods.attributesList as attr>
							<#if attr.attrValList?? && attr.attrValList?size gt 0>
							<th>${attr.attrName!'-'}</th>
							</#if>
						</#list>
					</tr>
					<tr>
						<#list goods.attributesList as attr>
							<#if attr.attrValList?? && attr.attrValList?size gt 0>
							<td>${attr.attrValList[0].valueName!'-'}</td>
							</#if>
						</#list>
					</tr>
				</table>
				</#if>
			</td>
		</tr>
		</#list>
	</#if>
</table>
</div>
<div id="J_bottomPageBox" class="xs-pagebar clearfix">
<@xpage currentPage="${(page.pageNo)!0}" totalPage="${(page.pageCount)!0}" />
</div>
</body>
</html>